<template>
	<view class="home-container">
		<view class="text-center ">
			<image class="" src="/static/logo.png" style="width: 240px;" mode="aspectFit"></image>
		</view>

		<view class="padding flex flex-direction padding-top-xs">
			<button class="cu-btn bg-blue margin-bottom lg round " @click="gotoPages()"
				style="height: 100rpx;">开始刷题</button>
		</view>

		<view class="nav-list">
			<navigator hover-class='none' :url="'/pages/index/bankSelect?pid=' + item.categoryId" class="nav-li" navigateTo
				:class="'bg-'+item.color" :style="[{animation: 'show ' + ((index+1)*0.2+1) + 's 1'}]"
				v-for="(item,index) in elements" :key="index">
				<view class="nav-title">{{item.title}}</view>
				<view class="nav-name">{{item.name}}</view>
				<text :class="'cuIcon-' + item.cuIcon"></text>
			</navigator>
			<view class="text-center bg-white margin-tb-lg padding-top " style="width: 100%;">
				<Copyright></Copyright>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				elements: [{
						title: '医学考研',
						name: 'Postgraduate',
						color: 'blue',
						cuIcon: 'formfill',
						categoryId: 1,
					},
					{
						title: '医学规培 ',
						name: 'Training',
						color: 'blue',
						cuIcon: 'formfill',
						categoryId: 2,
					},
					{
						title: '职称考试',
						name: 'Professional',
						color: 'blue',
						cuIcon: 'formfill',
						categoryId: 3,
					},
					{
						title: '职业医师 ',
						name: 'Occupational',
						color: 'blue',
						cuIcon: 'formfill',
						categoryId: 4,
					},
				]
			}
		},
		methods: {
			gotoPages() {
				uni.switchTab({
					url: "/pages/index/index"
				})
			}
		},
		onShareAppMessage(res) {
		    return {
		      title: '医考真题汇',
		      path: '/pages/index/home'
		    }
		},
		onShareTimeline() {
			return {
			  title: '医考真题汇',
			  path: '/pages/index/home'
			}
		}
	}
</script>

<style scoped lang="scss">
	
	.home-container {
		background-color: #FFFFFF;
		position: absolute;
		left: 0;
		bottom: 0;
		top: 0;
		right: 0;
	}

	.nav-list {
		display: flex;
		flex-wrap: wrap;
		padding: 0px 40upx 0px;
		justify-content: space-between;
	}

	.nav-li {
		padding: 30upx;
		border-radius: 12upx;
		width: 45%;
		margin: 0 2.5% 40upx;
		background-size: cover;
		background-position: center;
		position: relative;
		z-index: 1;
	}

	.nav-li::after {
		content: "";
		position: absolute;
		z-index: -1;
		background-color: inherit;
		width: 100%;
		height: 100%;
		left: 0;
		bottom: -10%;
		border-radius: 10upx;
		opacity: 0.2;
		transform: scale(0.9, 0.9);
	}

	.nav-li.cur {
		color: #fff;
		background: rgb(94, 185, 94);
		box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
	}

	.nav-title {
		font-size: 32upx;
		font-weight: 300;
	}

	.nav-title::first-letter {
		font-size: 40upx;
		margin-right: 4upx;
	}

	.nav-name {
		font-size: 28upx;
		text-transform: Capitalize;
		margin-top: 20upx;
		position: relative;
	}

	.nav-name::before {
		content: "";
		position: absolute;
		display: block;
		width: 40upx;
		height: 6upx;
		background: #fff;
		bottom: 0;
		right: 0;
		opacity: 0.5;
	}

	.nav-name::after {
		content: "";
		position: absolute;
		display: block;
		width: 100upx;
		height: 1px;
		background: #fff;
		bottom: 0;
		right: 40upx;
		opacity: 0.3;
	}

	.nav-name::first-letter {
		font-weight: bold;
		font-size: 36upx;
		margin-right: 1px;
	}

	.nav-li text {
		position: absolute;
		right: 30upx;
		top: 30upx;
		font-size: 52upx;
		width: 60upx;
		height: 60upx;
		text-align: center;
		line-height: 60upx;
	}

	.text-light {
		font-weight: 300;
	}
	

</style>
